#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int m = 0, n = 0, a[50][10] = { 0 }, s = 0;
    scanf("%d%d", &m, &n);
    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < n; j++)
        {
            scanf("%d", &a[i][j]);
        }
    }
    for (int i = 0; i < m; i++)
    {
        s = 0;
        for (int j = 0; j < n; j++)
        {
            s += a[i][j];
        }
        printf("%d\n", s);
    }
    return 0;
}